import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

public class Demo4 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        //在此输入您的代码...
        int t = scan.nextInt();
        while (t > 0) {
            t--;
            int n = scan.nextInt();
            int m = scan.nextInt();
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = scan.nextInt();
            }
            Arrays.sort(arr);

            if (m < arr[0] || m > arr[n - 1]) {
                System.out.println("No");
            } else {
                System.out.println("YES");
            }

        }

        scan.close();
    }
}
